/**
 * Copyright (C) 2021 - 2031 O-Cubes Co., Ltd.
 */

/****************************************************************
 *  @file    pmu_test.c
 *  @brief   PMU testcase source file
 *  @version v1.0
 *  @date    03. Apr. 2023
 ****************************************************************/

#include "printf.h"
#include "hal_api.h"

static void pmu_pvd_fall_irq_handler(void *ptr)
{
	//TODO Save important Data
	printf("PMU Power OFF\r\n");
	Hal_Pmu_Enter_Bat_Mode();
}

static void pmu_pvd_rise_irq_handler(void *ptr)
{
	printf("PMU Power ON\r\n");
}


int32_t test_pmu(void)
{
	printf("\r\n[PMU]: TEST START\r\n");

	Hal_Pmu_Cfg_Pvd_Lv(PMU_PVD_LV_2_V_6);
	Hal_Pmu_RegisterCb(pmu_pvd_rise_irq_handler, pmu_pvd_fall_irq_handler);

	printf("[PMU]: TEST END\r\n");
	return 0;
}

